package restless.core {
	/**
	 * ...
	 * @author MNS
	 */
	public class RLEXMLData {
		
		private var _ids:Vector.<String> = new Vector.<String>;
		private var _data:Vector.<Array> = new Vector.<Array>;
		
		public function get ids():Vector.<String> {
			return _ids;
		}
		
		public function set ids(value:Vector.<String>):void {
			_ids = value;
		}
		
		public function get data():Vector.<Array> {
			return _data;
		}
		
		public function set data(value:Vector.<Array>):void {
			_data = value;
		}
		
		public function getData(id:String):Array {
			var i:int = _ids.length - 1;
			for (i; i > -1; i--) {
				if (_ids[i] == id) {
					return _data[i];
				}
			}
			return null;
		}
		
		public function clone():RLEXMLData {
			var tempData:RLEXMLData = new RLEXMLData();
			tempData.ids = new Vector.<String>;
			tempData.data = new Vector.<Array>;
			
			for (var i:int = 0; i < _ids.length - 1; i++) {
				tempData.ids.push(_ids[i]);
				tempData.data.push(_data[i]);
			}
			
			return tempData;
		}
	}
}